At present, electronic devices (in particular, mobile electronic devices, such as a smart phone, a tablet, a notebook computer, or a portable instrument light) that are powered by a battery are widely used in people's everyday life. These electronic devices are generally equipped with a battery charging and discharging control system. At times, a battery is disconnected due to a fault or a battery is manually inserted or removed. Therefore, if a situation of battery presence cannot be detected in time, a normal operation of the system may be potentially affected.